Skip to content

rootless: enable IPv6 in RootlessKit network namespace#5055

Open
Akshitguptaa wants to merge 2 commits into
containerd:mainfrom
Akshitguptaa:ipv6-rootless-2608
Open

rootless: enable IPv6 in RootlessKit network namespace#5055
Akshitguptaa wants to merge 2 commits into
containerd:mainfrom
Akshitguptaa:ipv6-rootless-2608

Conversation

@Akshitguptaa

Copy link
Copy Markdown

Adds CONTAINERD_ROOTLESS_ROOTLESSKIT_IPV6=(true|false) to enable IPv6 inside the
RootlessKit network namespace, wired through to rootlesskit --ipv6.

  • Documented in docs/rootless.md
  • Wired into hack/test-integration-rootless.sh for CI opt-in
  • TestRunContainerWithStaticIP6 now runs under rootless when the flag is set

Scope: covers --port-driver=builtin (the default). --port-driver=slirp4netns
does not yet support IPv6 port forwarding upstream
(rootless-containers/slirp4netns#276 is still open), so that path remains
unsupported here.

Fixes #2608

@AkihiroSuda AkihiroSuda added the area/rootless Rootless mode label Jul 9, 2026
Comment thread docs/rootless.md Outdated
Comment thread extras/rootless/containerd-rootless.sh Outdated
Comment thread hack/test-integration-rootless.sh
Comment thread pkg/rootlessutil/rootlessutil_linux.go Outdated
Comment thread extras/rootless/containerd-rootless.sh Outdated
Comment thread docs/rootless.md Outdated
* `CONTAINERD_ROOTLESS_ROOTLESSKIT_IPV6=(true|false)`: whether to enable IPv6 inside the RootlessKit network namespace.
Defaults to "false". After enabling this, create IPv6-capable CNI networks with
`nerdctl network create --ipv6 --subnet <v6-subnet>` as usual. Published ports over IPv6 are
supported with `--port-driver=builtin` (the default). `--port-driver=slirp4netns` does not yet

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it work with pasta too? (--net=pasta --port-driver=implicit)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this with pasta and --port-driver=implicit, but it currently fails during port exposure with no PortDriver is available. It looks like nerdctl's rootless-port hook expects the PortDriver API to be active when -p is passed, which isn't the case under implicit.

I've updated the docs in 5e18ed0 to explicitly note that pasta isn't supported for IPv6 port forwarding yet.

Comment thread pkg/rootlessutil/rootlessutil_linux.go Outdated
Comment thread extras/rootless/containerd-rootless.sh Outdated
Comment thread pkg/testutil/testutil_linux.go Outdated
Comment thread pkg/testutil/testutil_linux.go Outdated
Signed-off-by: akshitguptaa <akshitguptaa29@gmail.com>
func TestRunContainerWithStaticIP6(t *testing.T) {
if rootlessutil.IsRootless() {
t.Skip("Static IP6 assignment is not supported rootless mode yet.")
if rootlessutil.IsRootless() && !testutil.RootlessKitIPv6Enabled(context.Background()) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

t.Context should be used

Signed-off-by: akshitguptaa <akshitguptaa29@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support IPv6 in rootless

2 participants